package com.tts.repository;

import com.tts.entity.SystemLog;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.time.LocalDateTime;
import java.util.List;

@Repository
public interface SystemLogRepository extends JpaRepository<SystemLog, Long>, JpaSpecificationExecutor<SystemLog> {
    List<SystemLog> findByUserId(Long userId);
    
    List<SystemLog> findByOperation(String operation);
    
    List<SystemLog> findByCreatedTimeBetween(LocalDateTime start, LocalDateTime end);
    
    List<SystemLog> findByUserIdAndOperationAndCreatedTimeBetween(
        Long userId, String operation, LocalDateTime start, LocalDateTime end);
} 